/* 初始化样式
------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none !important;
}

html,
body,
#app {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  background-color: #FFFFFF;
  font-size: 14px;
  overflow: hidden;
  position: relative;
}

.flex-wrap {
  display: flex;
  flex-wrap: wrap;
}

.flex-header {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

/* 主布局样式
------------------------------- */
.layout-container {
  width: 100%;
  height: 100%;
  .layout-aside {
    background: var(--bg-menuBar);
    box-shadow: 2px 0 6px rgba(0, 21, 41, 0.01);
    height: inherit;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden !important;
    .el-scrollbar__view {
      overflow: hidden;
    }
  }
  .layout-header {
    padding: 0 !important;
  }
  .layout-main {
    padding: 0 !important;
    overflow: hidden;
    width: 100%;
    background-color: #f8f8f8;
  }
  .el-scrollbar {
    width: 100%;
  }
  // 此字段多次用到，建议不删除，如需修改，请重写覆盖样式
  .layout-view-bg-white {
    background: var(--el-color-white);
    width: 100%;
    height: 100%;
    border-radius: 4px;
    border: 1px solid var(--el-border-color-light, #ebeef5);
  }
  .layout-el-aside-br-color {
    border-right: 1px solid rgba(238, 238, 238, 1);
  }
  // pc端左侧导航样式
  .layout-aside-pc-220 {
    width: 220px !important;
    transition: width 0.3s ease;
  }
  .layout-aside-pc-64 {
    width: 64px !important;
    transition: width 0.3s ease;
  }
  .layout-aside-pc-1 {
    width: 1px !important;
    transition: width 0.3s ease;
  }
  // 手机端左侧导航样式
  .layout-aside-mobile {
    position: fixed;
    top: 0;
    left: -220px;
    width: 220px;
    z-index: 9999999;
  }
  .layout-aside-mobile-close {
    left: -220px;
    transition: all 0.3s cubic-bezier(1, -0.04, 0, 1.32);
  }
  .layout-aside-mobile-open {
    left: 0;
    transition: all 0.3s cubic-bezier(0.53, -0.26, 0.42, 1.18);
  }
  .layout-aside-mobile-mode {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999998;
  }
  .layout-scrollbar {
    @extend .el-scrollbar;
    padding: 15px;
  }
  .layout-mian-height-50 {
    height: calc(100vh - 50px);
  }
  .layout-columns-warp {
    flex: 1;
    display: flex;
    overflow: hidden;
  }
  .layout-hide {
    display: none;
  }
}

/* element plus 全局样式
------------------------------- */
.layout-breadcrumb-seting {
  .el-divider {
    background-color: rgba(230, 230, 230, 1);
  }
}

/* nprogress 进度条跟随主题颜色
------------------------------- */
#nprogress {
  .bar {
    background: var(--color-primary) !important;
    z-index: 9999999 !important;
  }
}

/* flex 弹性布局
------------------------------- */
.flex {
  display: flex;
}
.flex-auto {
  flex: 1;
}
.flex-center {
  @extend .flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
}
.flex-margin {
  margin: auto;
}
.flex-warp {
  display: flex;
  flex-wrap: wrap;
  -ms-flex-direction: row;
  flex-direction: row;
}

/* cursor 鼠标形状
------------------------------- */
// 默认
.cursor-default {
  cursor: default !important;
}
// 帮助
.cursor-help {
  cursor: help !important;
}
// 手指
.cursor-pointer {
  cursor: pointer !important;
}
// 移动
.cursor-move {
  cursor: move !important;
}

/* 宽高 100%
------------------------------- */
.w100 {
  width: 100% !important;
}
.h100 {
  height: 100% !important;
}
.vh100 {
  height: 100vh !important;
}
.max100vh {
  max-height: 100vh !important;
}
.min100vh {
  min-height: 100vh !important;
}

/* 颜色值
------------------------------- */
.color-primary {
  color: var(--color-primary);
}
.color-success {
  color: var(--color-success);
}
.color-warning {
  color: var(--color-warning);
}
.color-danger {
  color: var(--color-danger);
}
.color-info {
  color: var(--color-info);
}

$position: (absolute, fixed, relative, static, sticky);

@each $var in $position {
  .#{$var} {
    position: #{$var};
  }
}

/* 字体大小全局样式
------------------------------- */
@for $i from 10 through 32 {
  .font#{$i} {
    font-size: #{$i}px !important;
  }
}

/* 外边距、内边距全局样式
------------------------------- */
@for $i from 1 through 35 {
  .mt#{$i} {
    margin-top: #{$i}px !important;
  }
  .mr#{$i} {
    margin-right: #{$i}px !important;
  }
  .mb#{$i} {
    margin-bottom: #{$i}px !important;
  }
  .ml#{$i} {
    margin-left: #{$i}px !important;
  }
  .pt#{$i} {
    padding-top: #{$i}px !important;
  }
  .pr#{$i} {
    padding-right: #{$i}px !important;
  }
  .pb#{$i} {
    padding-bottom: #{$i}px !important;
  }
  .pl#{$i} {
    padding-left: #{$i}px !important;
  }
}

@for $i from 0 through 5 {
  /** margin padding 辅助类
   *  m
   */
}

.table-external {
  .table-operation {
    margin-right: 0;

    .el-button:last-child {
      margin-right: 0;
    }
  }
}

.card-container {
  margin: 10px;
  height: calc(100% - 20px);
}

.ant-page-header {
  box-sizing: border-box;
  margin: 0;
  color: #000000d9;
  font-size: 14px;
  font-variant: tabular-nums;
  line-height: 1.5715;
  list-style: none;
  font-feature-settings: tnum;
  position: sticky;
  z-index: 8;
  top: 0px;
  padding: 16px 24px;
  background-color: #fff;
}

.ant-drawer-extra {
  position: absolute;
  bottom: 0px;
  width: 100%;
  border-top: 1px solid rgb(232, 232, 232);
  padding: 10px 16px;
  text-align: right;
  left: 0px;
  background: rgb(255, 255, 255);
  border-radius: 0px 0px 4px 4px;
  z-index: 10;
}

/* 屏幕小于1440px */
@media screen and (max-width: 1440px) {
  .ant-drawer {
    width: 60% !important;
  }
  .custom-dialog {
    width: 60% !important;
  }
}

/* 屏幕小于 992px */
@media screen and (max-width: 992px) {
  .ant-drawer {
    width: 90% !important;
  }
  .custom-dialog {
    width: 90% !important;
  }
}

.ant-drawer {
  .el-drawer__header {
    padding: 16px 24px;
    margin-bottom: 0;
    border-bottom: 1px solid #e8e8e8;
  }

  &-content {
    width: 100%;
    height: 100%;
  }
}

.ant-drawer-content {
  position: relative;
  z-index: 1;
  overflow: auto;
  background-color: #fff;
  background-clip: padding-box;
  border: 0;
}

.ant-drawer-wrapper-body {
  display: flex;
  flex-flow: column nowrap;
  width: 100%;
  height: 100%;
}

.ant-drawer-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #000000d9;

  &-title {
    .ant-drawer-header-title {
      display: flex;
      flex: 1;
      align-items: center;
      justify-content: space-between;
    }
  }

  .ant-drawer-close {
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #94979b;
    background-color: transparent;
  }
}
.ant-drawer-title {
  flex: 1;
  margin: 0;
  color: #000000d9;
  font-weight: 500;
  font-size: 16px;
}

.ant-drawer-extra {
  .el-button:last-child {
    margin-right: 0;
  }
}

.ant-drawer-body {
  flex-grow: 1;
  padding: 24px;
  overflow: auto;
  font-size: 14px;
  line-height: 1.5715;
  word-wrap: break-word;
}

.basic-drawer-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 0 12px 0 20px;
  text-align: right;
  background-color: #fff;
  border-top: 1px solid #d9d9d9;
}

.all-scroll {
  cursor: all-scroll;
}
.auto {
  cursor: auto;
}
.col-resize {
  cursor: col-resize;
}
.crosshair {
  cursor: crosshair;
}
.default {
  cursor: default;
}
.e-resize {
  cursor: e-resize;
}
.ew-resize {
  cursor: ew-resize;
}
.grabbing {
  cursor: grabbing;
}
.help {
  cursor: help;
}
.move {
  cursor: move;
}
.n-resize {
  cursor: n-resize;
}
.ne-resize {
  cursor: ne-resize;
}
.nesw-resize {
  cursor: nesw-resize;
}
.ns-resize {
  cursor: ns-resize;
}
.nw-resize {
  cursor: nw-resize;
}
.nwse-resize {
  cursor: nwse-resize;
}
.no-drop {
  cursor: no-drop;
}
.none {
  cursor: none;
}
.not-allowed {
  cursor: not-allowed;
}
.pointer {
  cursor: pointer;
}
.progress {
  cursor: progress;
}
.row-resize {
  cursor: row-resize;
}
.s-resize {
  cursor: s-resize;
}
.se-resize {
  cursor: se-resize;
}
.sw-resize {
  cursor: sw-resize;
}
.text {
  cursor: text;
}
.w-resize {
  cursor: w-resize;
}
.wait {
  cursor: wait;
}
.zoom-in {
  cursor: zoom-in;
}
.zoom-out {
  cursor: zoom-out;
}

.manage-wrap {
  .manage-buttons {
    text-align: right;
    @media screen and (max-width: 768px) {
      text-align: left;
    }
  }
  .el-form-item {
    margin-bottom: 15px;
  }
}

.overflow-hidden {
  overflow: hidden;
}

.shadow-only-bottom {
  box-shadow: 0px 7px 7px -7px #5e5e5e;
}
.shadow-only-right {
  box-shadow: 7px 0px 7px -7px #5e5e5e;
}
.shadow-only-left {
  box-shadow: -7px 0px 7px -7px #5e5e5e;
}
.showdow-only-top {
  box-shadow: 0px -7px 7px -7px #5e5e5e;
}

// 输入框文本对齐
$align: (left, right, center);
@each $var in $align {
  .input-#{$var}-align {
    .el-input__inner {
      text-align: #{$var} !important;
    }
  }
}

// 内外间距辅助类
// 参考tailwindcss实现：https://www.tailwindcss.cn/
@for $i from 0 through 12 {
  // margin 设置
  .m-#{$i} {
    margin: #{$i * 0.25}rem;
  }
  .-m-#{$i} {
    margin: #{$i * -0.25}rem;
  }
  .my-#{$i} {
    margin-top: #{$i * 0.25}rem;
    margin-bottom: #{$i * 0.25}rem;
  }
  .mx-#{$i} {
    margin-left: #{$i * 0.25}rem;
    margin-right: #{$i * 0.25}rem;
  }
  .-my-#{$i} {
    margin-top: #{$i * -0.25}rem;
    margin-bottom: #{$i * -0.25}rem;
  }
  .-mx-#{$i} {
    margin-left: #{$i * -0.25}rem;
    margin-right: #{$i * -0.25}rem;
  }
  .-mt-#{$i} {
    margin-top: #{$i * -0.25}rem;
  }
  .mt-#{$i} {
    margin-top: #{$i * 0.25}rem;
  }
  .mb-#{$i} {
    margin-bottom: #{$i * 0.25}rem;
  }
  .-mb-#{$i} {
    margin-bottom: #{$i * -0.25}rem;
  }
  .mr-#{$i} {
    margin-right: #{$i * 0.25}rem;
  }
  .-mr-#{$i} {
    margin-right: #{$i * -0.25}rem;
  }
  .-ml-#{$i} {
    margin-left: #{$i * -0.25}rem;
  }
  .ml-#{$i} {
    margin-left: #{$i * 0.25}rem;
  }

  // padding 设置
  .p-#{$i} {
    padding: #{$i * 0.25}rem;
  }
  .-p-#{$i} {
    padding: #{$i * -0.25}rem;
  }
  .py-#{$i} {
    padding-top: #{$i * 0.25}rem;
    padding-bottom: #{$i * 0.25}rem;
  }
  .px-#{$i} {
    padding-left: #{$i * 0.25}rem;
    padding-right: #{$i * 0.25}rem;
  }
  .-py-#{$i} {
    padding-top: #{$i * -0.25}rem;
    padding-bottom: #{$i * -0.25}rem;
  }
  .-px-#{$i} {
    padding-left: #{$i * -0.25}rem;
    padding-right: #{$i * -0.25}rem;
  }
  .-pt-#{$i} {
    padding-top: #{$i * -0.25}rem;
  }
  .pt-#{$i} {
    padding-top: #{$i * 0.25}rem;
  }
  .pb-#{$i} {
    padding-bottom: #{$i * 0.25}rem;
  }
  .-pb-#{$i} {
    padding-bottom: #{$i * -0.25}rem;
  }
  .pr-#{$i} {
    padding-right: #{$i * 0.25}rem;
  }
  .-pr-#{$i} {
    padding-right: #{$i * -0.25}rem;
  }
  .-pl-#{$i} {
    padding-left: #{$i * -0.25}rem;
  }
  .pl-#{$i} {
    padding-left: #{$i * 0.25}rem;
  }
}

// 首尾的粒度设置
@for $i from 1 through 3 {
  @if ($i % 2 == 1) {
    // margin 设置
    .m-#{floor($i/2)}_5 {
      margin: #{$i / 2 * 0.25}rem;
    }
    .my-#{floor($i/2)}_5 {
      margin-top: #{$i / 2 * 0.25}rem;
      margin-bottom: #{$i / 2 * 0.25}rem;
    }
    .mx-#{floor($i/2)}_5 {
      margin-left: #{$i / 2 * 0.25}rem;
      margin-right: #{$i / 2 * 0.25}rem;
    }
    .-my-#{floor($i/2)}_5 {
      margin-top: #{$i / 2 * -0.25}rem;
      margin-bottom: #{$i / 2 * -0.25}rem;
    }
    .-mx-#{floor($i/2)}_5 {
      margin-left: #{$i / 2 * -0.25}rem;
      margin-right: #{$i / 2 * -0.25}rem;
    }
    .-m-#{floor($i/2)}_5 {
      margin: #{$i / 2 * -0.25}rem;
    }
    .-mt-#{floor($i/2)}_5 {
      margin-top: #{$i / 2 * -0.25}rem;
    }
    .mt-#{floor($i/2)}_5 {
      margin-top: #{$i / 2 * 0.25}rem;
    }
    .mb-#{floor($i/2)}_5 {
      margin-bottom: #{$i / 2 * 0.25}rem;
    }
    .-mb-#{floor($i/2)}_5 {
      margin-bottom: #{$i / 2 * -0.25}rem;
    }
    .mr-#{floor($i/2)}_5 {
      margin-right: #{$i / 2 * 0.25}rem;
    }
    .-mr-#{floor($i/2)}_5 {
      margin-right: #{$i / 2 * -0.25}rem;
    }
    .-ml-#{floor($i/2)}_5 {
      margin-left: #{$i / 2 * -0.25}rem;
    }
    .ml-#{floor($i/2)}_5 {
      margin-left: #{$i / 2 * 0.25}rem;
    }

    // padding 设置
    .p-#{floor($i/2)}_5 {
      padding: #{$i / 2 * 0.25}rem;
    }
    .py-#{floor($i/2)}_5 {
      padding-top: #{$i / 2 * 0.25}rem;
      padding-bottom: #{$i / 2 * 0.25}rem;
    }
    .px-#{floor($i/2)}_5 {
      padding-left: #{$i / 2 * 0.25}rem;
      padding-right: #{$i / 2 * 0.25}rem;
    }
    .-py-#{floor($i/2)}_5 {
      padding-top: #{$i / 2 * -0.25}rem;
      padding-bottom: #{$i / 2 * -0.25}rem;
    }
    .-px-#{floor($i/2)}_5 {
      padding-left: #{$i / 2 * -0.25}rem;
      padding-right: #{$i / 2 * -0.25}rem;
    }
    .-p-#{floor($i/2)}_5 {
      padding: #{$i / 2 * -0.25}rem;
    }
    .-pt-#{floor($i/2)}_5 {
      padding-top: #{$i / 2 * -0.25}rem;
    }
    .pt-#{floor($i/2)}_5 {
      padding-top: #{$i / 2 * 0.25}rem;
    }
    .pb-#{floor($i/2)}_5 {
      padding-bottom: #{$i / 2 * 0.25}rem;
    }
    .-pb-#{floor($i/2)}_5 {
      padding-bottom: #{$i / 2 * -0.25}rem;
    }
    .pr-#{floor($i/2)}_5 {
      padding-right: #{$i / 2 * 0.25}rem;
    }
    .-pr-#{floor($i/2)}_5 {
      padding-right: #{$i / 2 * -0.25}rem;
    }
    .-pl-#{floor($i/2)}_5 {
      padding-left: #{$i / 2 * -0.25}rem;
    }
    .pl-#{floor($i/2)}_5 {
      padding-left: #{$i / 2 * 0.25}rem;
    }
  }
}

// 其他设置
@for $i from 4 through 24 {
  // margin 设置
  .m-#{floor($i*4)} {
    margin: #{$i}rem;
  }
  .-m-#{floor($i*4)} {
    margin: #{-$i}rem;
  }
  .my-#{floor($i*4)} {
    // margin: #{$i}rem 0;
    margin-top: #{$i}rem;
    margin-bottom: #{$i}rem;
  }
  .mx-#{floor($i*4)} {
    // margin: 0 #{$i}rem;
    margin-left: #{$i}rem;
    margin-right: #{$i}rem;
  }
  .-my-#{floor($i*4)} {
    // margin: #{-$i}rem 0;
    margin-top: #{-$i}rem;
    margin-bottom: #{-$i}rem;
  }
  .-mx-#{floor($i*4)} {
    // margin: 0 #{-$i}rem;
    margin-left: #{-$i}rem;
    margin-right: #{-$i}rem;
  }
  .-m-#{floor($i*4)} {
    margin: #{-$i}rem;
  }
  .-mt-#{floor($i*4)} {
    margin-top: #{-$i}rem;
  }
  .mt-#{floor($i*4)} {
    margin-top: #{$i}rem;
  }
  .mb-#{floor($i*4)} {
    margin-bottom: #{$i}rem;
  }
  .-mb-#{floor($i*4)} {
    margin-bottom: #{-$i}rem;
  }
  .mr-#{floor($i*4)} {
    margin-right: #{$i}rem;
  }
  .-mr-#{floor($i*4)} {
    margin-right: #{-$i}rem;
  }
  .-ml-#{floor($i*4)} {
    margin-left: #{-$i}rem;
  }
  .ml-#{floor($i*4)} {
    margin-left: #{$i}rem;
  }

  // padding 设置
  .p-#{floor($i*4)} {
    padding: #{$i}rem;
  }
  .-p-#{floor($i*4)} {
    padding: #{-$i}rem;
  }
  .py-#{floor($i*4)} {
    // padding: #{$i}rem 0;
    padding-top: #{$i}rem;
    padding-bottom: #{$i}rem;
  }
  .px-#{floor($i*4)} {
    // padding: 0 #{$i}rem;
    padding-left: #{$i}rem;
    padding-right: #{$i}rem;
  }
  .-py-#{floor($i*4)} {
    // padding: #{-$i}rem 0;
    padding-top: #{-$i}rem;
    padding-bottom: #{-$i}rem;
  }
  .-px-#{floor($i*4)} {
    // padding: 0 #{-$i}rem;
    padding-left: #{-$i}rem;
    padding-right: #{-$i}rem;
  }
  .-p-#{floor($i*4)} {
    padding: #{-$i}rem;
  }
  .-pt-#{floor($i*4)} {
    padding-top: #{-$i}rem;
  }
  .pt-#{floor($i*4)} {
    padding-top: #{$i}rem;
  }
  .pb-#{floor($i*4)} {
    padding-bottom: #{$i}rem;
  }
  .-pb-#{floor($i*4)} {
    padding-bottom: #{-$i}rem;
  }
  .pr-#{floor($i*4)} {
    padding-right: #{$i}rem;
  }
  .-pr-#{floor($i*4)} {
    padding-right: #{-$i}rem;
  }
  .-pl-#{floor($i*4)} {
    padding-left: #{-$i}rem;
  }
  .pl-#{floor($i*4)} {
    padding-left: #{$i}rem;
  }
}

.mr-0 {
  margin-right: 0rem !important;
}

.my-2 {
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

.header-title {
  color: #72767b;
  font-size: 16px;
  font-weight: 400;
  margin-right: 8px;
}
